You start with a normal room.
All the walls are medium green. If you know the color coding, this means they represent
the part of the wall that comes between the floor and ceiling surfaces.
Select one of the walls and lower the ceiling by 8 clicks.
The bright green shows that the new section is above the ceiling surface. Note that
this new section is directly above the medium green section. This is important.
Now apply a texture to that bright green section.
Everything is normal. It looks like it is supposed to.
But now we decide to bring down that extra section at the top of the wall. This is
done using the R-F keys. Press the F key to lower that top section 4 clicks.
It looks just like we wanted. Now turn on face edit to put a texture on that top section.
WHAT HAPPENED? The texture we already applied next to the medium green section has now
jumped to the top. It no longer touches the medium green section.
This appears to only happen on the ceiling sections. The floor sections behave as you would expect.
So the order that the textures display depends on the number of textures on the wall.
Again, start in a normal room, but with a wall block in the middle.
The sides have already been split into 3 texture sections. Now apply a texture to the
top and bottom sections on both sides.
Everything looks good. Since we know about the problem with ceiling side textures,
let's work with the 2 floor sections this time.
I decide that on one side, I will slope the floor up, then raise up the extra section at the bottom
using the E-D keys. This will give me a small triangle section for textures, and a rectangle below that.
That's what I wanted. Now turn on face edit and apply textures.
But the texture on the other side has disappeared! (Well, so did the one on the side we changed,
but I wanted to change that to a triangle texture anyway). That is because it is on the section just
below the medium green, and that section is now zero clicks high. How to fix it? Just reapply the texture
to the bottom section.
That fixes it in the project. But in the room mesh, no polygon is created for the section that is zero clicks high. On that side of the wall, there are only 3 polygons. When there are only 3 polygons (textures) on a wall, the middle one is between the floor and ceiling, and the bottom texture goes just below that one. This is the way the wall was originally textured. In the room mesh, there is no way to know about the hidden texture.
A way to deal with this problem is to collect all the polygons for all 4 sides of the block, then analyze how they fit together. The correct configuration could be determined with enough analysis. But more problems arise when a wall block is against the gray squares, or more than one wall block is used to form a wall in a room. In this case, you won't have polygons for all 4 sides, which really complicates things.
So, since this was supposed to be a quick-and-dirty program, I leave it to you to make the
minor adjustments to the project.